home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 May: Tool Chest / Dev.CD May 97 TC.toast / Sample Code / Snippets / Files / stdFilterHacking / stdFilterHacking • Me Read Good next >
Encoding:
Text File  |  1996-09-17  |  1.4 KB  |  34 lines  |  [TEXT/CWIE]

  1. stdFilterHacking
  2.  
  3. For those of you who have been using the new Standard Dialog Filter
  4. in 7.0 and later (documented in tech note #304, which has been renamed 
  5. to MM.{something}.PendingUpdates) you may have encountered some odd behaviour
  6. when you bring up another dialog or alert in front of
  7. a dialog using the standard filter.
  8.  
  9. If you have dimmed (de-hilited, disabled) the OK or Cancel button and
  10. bring up a dialog on top, when you dismiss the top dialog the dialog
  11. where the OK button was dimmed will suddenly have the OK button enabled!
  12.  
  13. This is a behaviour of the standard filter.  When the standard filter
  14. gets an Activate event, it will automatically enable the default and
  15. cancel buttons (set with SetDialogDefaultItem and SetDialogCancelItem), it
  16. is assuming that the only reason those buttons were disabled was because they
  17. were in a deactivated window.
  18.  
  19. The filter has no state-saving routines or caches to remember what the old state
  20. of the buttons was, so it just slams them active again.
  21.  
  22. This may not be what you want.  If you disable an OK or Cancal button, use the
  23. standard filter, and bring another dialog or alert up on top of that dialog, 
  24. you need to add a little extra code in your own filter to handle that
  25. situation.
  26.  
  27. The code is included here, look in the filterIt function included in 
  28. stdFilterHacking.c.
  29.  
  30. Better Living Through Code.
  31.  
  32. C.K. Haun
  33. Apple DTS
  34. ALink: DEVSUPPORT